package com.yikome.order.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.order.entity.OrderAddress;

@Repository
public interface OrderAddressRepository extends CommonRepository<OrderAddress, Long> {

	@Query("select t from OrderAddress t where t.yn= 1 and t.id = id")
	OrderAddress findOrderAddress(@Param("id")Long id);
	
	@Query("select t from OrderAddress t where t.yn= 1 and t.orderCode = :orderCode")
	OrderAddress findOrderAddress(@Param("orderCode")String orderCode);
	
	long deleteByOrderCode(String orderCode);

}
